package com.xihu.socielserver.service;

import com.xihu.socielserver.entity.MyActivity;
import com.xihu.socielserver.mapper.MyActivityDao;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyActivityBiz {
    @Resource
    private MyActivityDao mapper;

    public int  insertMyActivity(MyActivity myActivity) {
        //return mapper.insert(myActivity);
        if(mapper.insert(myActivity) > 0){
            return 1;
        }else{
            return 0;
        }
    }

    public  List<MyActivity> showMyActivity(int userId){
        return mapper.selectAllMyactivity(userId);
    }

    public List<MyActivity> selectMyActivity(MyActivity myActivity){
        return mapper.selectActivity(myActivity);
    }

    public int  updateMyActivity(MyActivity myActivity){
        return mapper.updateState(myActivity);
    }
}
